You can create your own filter effects — smoothing, sharpening, intensifying, enhancing — by convolving an image with a customized 2D or 3D kernel. Convolution is done by multiplying a pixel’s value and its neighboring pixel values by a matrix and then determining the value of a central pixel by adding the weighted values of all its neighbors together. You should note that differently sized kernels containing different patterns of numbers, as shown in the simple example below, will produce different results under convolution.
Edited kernel for the convolution filter
Below are a number of kernel examples with matrices that can produce different effects.
1 |
1 |
1 |
|
0 |
1 |
0 |
|
0 |
-1 |
0 |
|
-1 |
-1 |
-1 |
1 |
1 |
1 |
|
1 |
4 |
1 |
|
-1 |
5 |
-1 |
|
-1 |
9 |
-1 |
1 |
1 |
1 |
|
0 |
1 |
0 |
|
0 |
-1 |
0 |
|
-1 |
-1 |
-1 |
Unweighted 3x3 smoothing kernel |
|
Weighted 3x3 smoothing kernel with Gaussian blur |
|
Kernel to make images sharper |
|
Intensified sharper image |
You should note that larger kernels can increase filtering effects. In the example below, the smoother area increases with the larger kernel area.
0 |
1 |
2 |
1 |
0 |
1 |
4 |
8 |
4 |
1 |
2 |
8 |
16 |
8 |
2 |
1 |
4 |
8 |
4 |
1 |
0 |
1 |
2 |
1 |
0 |
An important issue that arises within the convolution process centers on the fact that the convolution kernel will extend beyond the borders of the image when it is applied to border pixels. A common approach to dealing with border effects is to pad the original image with extra rows and columns based on the filter size. The technique used in Dragonfly to remedy border effects is to reflect the image at the borders. For example, column[-1] = column [1], column [-2] = column [2], and so on. For more information, go to http://homepages.inf.ed.ac.uk/rbf/HIPR2/convolve.htm and http://homepages.inf.ed.ac.uk/rbf/HIPR2/kernel.htm.
If you are working with a 3D shape, you can navigate between the different planes with the drop-down menu or the Next and Previous icons.
If required, you can modify the matrix values or choose another shape.